package com.example.big_event.pojo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
// 这个是文章分类的实体类 用来对应数据库中的category
@TableName("category")
public class Category  {

    // 主键ID
    @NotNull(message="[ID]不能为空")
    private Integer id;

    //分类名称
    private String categoryName;

    // 分类别名
    private String categoryAlias;

    // 创建人ID
    private Integer createUser;


    //创建时间
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    //修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    public Category(String categoryName, String categoryAlias, Integer createUser) {
        this.categoryName = categoryName;
        this.categoryAlias = categoryAlias;
        this.createUser = createUser;
    }

}
